package com.zxq.ruoyi;

import com.alibaba.fastjson.JSON;
import com.zxq.ruoyi.domain.IotCmd;
import com.zxq.ruoyi.service.impl.IotCmdServiceImpl;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import javax.annotation.PostConstruct;
import java.util.List;


@MapperScan
@EnableDiscoveryClient
@SpringBootApplication
public class IotRuoYiApplication {

    public static void main(String[] args) {
        SpringApplication.run(IotRuoYiApplication.class, args);
    }


    @Autowired
    IotCmdServiceImpl iotCmdService;


    @PostConstruct
    public void initRead() {
       List<IotCmd> iotCmds = iotCmdService.selectIotCmdList(null);
       System.out.println(JSON.toJSON(iotCmds));
    }



}
